import request from '@/utils/request'

const loginApi = {
  // userLogin: '/api/auth/user/login',
}

class Service {
  //获取数据
  static cate_datas(){
    return request({
      url:`/Question/cate/`,
      method:'GET',
      json:true,
    }).then((res)=>{
      return res
    })
  }
  //添加数据
  static cate_create(data:any){
    return request({
      url:`/Question/cate/`,
      method:'post',
      json:true,
      data
    }).then((res)=>{
      return res
    })
  }
  //修改
  static cate_put(data:any){
    return request({
      url:`/Question/cate/${data.id}`,
      method:'put',
      json:true,
      data
    }).then((res)=>{
      return res
    })
  }
  //删除
  static cate_del(data:any){
    return request({
      url:`/Question/cate/${data.id}`,
      method:'delete',
      json:true,
      data
    }).then((res)=>{
      return res
    })
  }
  //获取题目信息
  static question_datas(){
    return request({
      url:`/Question/question/`,
      method:'GET',
      json:true,
    }).then((res)=>{
      return res
    })
  }
  //添加题
  static question_create(data:any){
    return request({
      url:`/Question/question/`,
      method:'post',
      json:true,
      data
    }).then((res)=>{
      return res
    })
  }
  static question_datas1(data:any){
    return request({
      url:`/Question/question/?id=${data.id}`,
      method:'GET',
      json:true,
    }).then((res)=>{
      return res
    })
  }
  //删除
  static question_del(data:any){
    return request({
      url:`/Question/question/${data}`,
      method:'delete',
      json:true,
      data
    }).then((res)=>{
      return res
    })
  }
  //修改
  static question_put(data:any){
    return request({
      url:`/Question/question/${data.id}`,
      method:'put',
      json:true,
      data
    }).then((res)=>{
      return res
    })
  }
  //搜索
  static question_ss(data:any){
    return request({
      url:`/Question/question/?title=${data}`,
      method:'get',
      json:true,
      data
    }).then((res)=>{
      return res
    })
  }
  //联合查询
  static question_lh(data:any){
    return request({
      url:`/Question/question/?title=${data.title}&id=${data.cart}`,
      method:'get',
      json:true,
      data
    }).then((res)=>{
      return res
    })
  }
}
export default Service
